package com.lz.b;

/**
 * @ClassName Demo19
 * @Description 死循环
 * @Author 2214361854
 * @Date 2022/5/27 10:41
 * @Version 1.0
 */
public class Demo19 {
    /**
     * 分别通过for循环/While循环/do-While循环写一个死循环
     */
    public static void main(String[] args) {
        /*forS();
        whiles();
        doWhiles();*/
    }

    private static void doWhiles() {
        do {
            System.out.println("do-While循环死循环");
        } while (true);
    }

    private static void whiles() {
        while (true) {
            System.out.println("while死循环");
        }
    }

    private static void forS() {
        for (int i = 1; ; i++) {
            System.out.println("for死循环");
        }
    }
}
